# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from typing import Union, List
from fastapi import Query
from pydantic import BaseModel, Field


class UpgradeSearchIn(BaseModel):
    """ 版本搜索参数 """
    page_no: int = Query(gt=0, default=1, description="当前页码")
    page_size: int = Query(gt=0, le=200, default=15, description="每页条数")


class UpgradeSystemIn(BaseModel):
    """ 升级系统参数 """
    version_id: int = Field(..., gt=0, description="版本ID")
    version_no: int = Query(..., min_length=1, max_length=30, description="版本编号")


"""--------------- Separator ---------------"""


class UpgradeListVo(BaseModel):
    """ 版本列表Vo """
    id: int = Field(description="ID")
    publish_time: str = Field(description="发布时间")
    version_no: str = Field(description="版本号")
    remarks: str = Field(description="注意事项")
    improve: List[str] = Field(description="新增内容")
    repairs: List[str] = Field(description="修复内容")
    optimize: List[str] = Field(description="优化内容")
    able_update: bool = Field(description="允许更新: [false=否, true=是]")
    curr_version: bool = Field(description="当前版本: [false=否, true=是]")

    class Config:
        json_schema_extra = {
            "example": {

            }
        }
